﻿
namespace Graphix.Elements
{
    using System.Drawing;
    using SvgNet.SvgGdi;

    public class Arc : BaseElement
    {
        #region Implementation of IElement

        public float Thickness { get; set; }

        public float Width { get; set; }

        public float Height { get; set; }

        public float StartAngle { get; set; }

        public float SweepAngle { get; set; }

        public Arc(float x, float y, float width, float height, float startAngle, float sweepAngle, float thickness)
            : this(new PointF(x, y), width, height, startAngle, sweepAngle, thickness)
        {
        }

        public Arc(PointF position, float width, float height, float startAngle, float sweepAngle, float thickness) : 
            base(position.X, position.Y)
        {
            this.Width = width;
            this.Height = height;
            this.StartAngle = startAngle;
            this.SweepAngle = sweepAngle;
            this.Thickness = thickness;
        }

        public override void Draw(IGraphics graphics)
        {
            graphics.DrawArc(new Pen(this.Color) { Width = this.Thickness },
                this.Position.X,
                this.Position.Y,
                this.Width,
                this.Height,
                this.StartAngle,
                this.SweepAngle,
                this.Attributes);
        }
        #endregion
    }
}
